package com.android.phoenix.util;

import java.io.IOException;
import java.io.InputStream;

import android.content.Context;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.util.Log;

public class AssetsUtil {
	
	private static final String TAG = AssetsUtil.class.getSimpleName();
	
	public static Bitmap getImage(Context context, String sn) {
		Bitmap bm = null;
		try {
			InputStream input = context.getAssets().open(sn);
			BitmapFactory.Options op = new BitmapFactory.Options();
			op.inPurgeable = true;
			op.inInputShareable = true;
			bm = BitmapFactory.decodeStream(input, null, op);
			input.close();
		} catch (IOException e) {
			Log.e(TAG, e.getMessage());
		}
		return bm;
	}
}
